package com.bst.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bst.system.mapper.SysUserDeptMapper;
import com.bst.system.domain.SysUserDept;
import com.bst.system.service.ISysUserDeptService;
import com.bst.common.core.text.Convert;

/**
 * 用户科室Service业务层处理
 * 
 * @author laoliu
 * @date 2024-11-25
 */
@Service
public class SysUserDeptServiceImpl implements ISysUserDeptService 
{
    @Autowired
    private SysUserDeptMapper sysUserDeptMapper;

    /**
     * 查询用户科室
     * 
     * @param userId 用户科室主键
     * @return 用户科室
     */
    @Override
    public SysUserDept selectSysUserDeptByUserId(Long userId)
    {
        return sysUserDeptMapper.selectSysUserDeptByUserId(userId);
    }

    /**
     * 查询用户科室列表
     * 
     * @param sysUserDept 用户科室
     * @return 用户科室
     */
    @Override
    public List<SysUserDept> selectSysUserDeptList(SysUserDept sysUserDept)
    {
        return sysUserDeptMapper.selectSysUserDeptList(sysUserDept);
    }

    /**
     * 新增用户科室
     * 
     * @param sysUserDept 用户科室
     * @return 结果
     */
    @Override
    public int insertSysUserDept(SysUserDept sysUserDept)
    {
        return sysUserDeptMapper.insertSysUserDept(sysUserDept);
    }

    /**
     * 修改用户科室
     * 
     * @param sysUserDept 用户科室
     * @return 结果
     */
    @Override
    public int updateSysUserDept(SysUserDept sysUserDept)
    {
        return sysUserDeptMapper.updateSysUserDept(sysUserDept);
    }

    @Override
    public int deleteOneSysUserDept(Long userId, Long deptId) {
        return sysUserDeptMapper.deleteOneSysUserDept(userId,deptId);
    }
}
